package cn.accp.mvc.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;

import cn.accp.mvc.entity.User;

@Controller
public class HelloController {
	@RequestMapping("/login1")
	public String login(User user,ModelMap modelMap){
		System.out.println("----------login-----");
		System.out.println(user);
		modelMap.addAttribute("user", user);
		return "getlogin.do";//默认转发（getlogin方法跳转）
		//return "forward:index.jsp";//转发
		//return "redirect:index.jsp";//重定向
	}
	
	@RequestMapping("/getlogin")
	public String getlogin(){
		System.out.println("----------getlogin-----");
		return "login.jsp";
	}
	
	
	
}
